package com.atguigu.exer;

public class SuShu {
    public static void main(String[] args) {

        boolean flag = true;
        int sum = 0;
        int i;
        for(i = 3;i <= 100;i++){
            for(int j = 2;j <= Math.sqrt(i);j++){
                if(i % j == 0){
                    flag = false;
                    break;
                }
            }
            if(flag == true){
                sum += i;
                System.out.println(i);
            }
            flag = true;
        }
        System.out.println(sum);
    }
}

